﻿@using KPIS.GERP.Models.ICM
@model InventoryStockTaking

@{
    ViewBag.Title = "ข้อมูลระบบพัสดุและครุภัณฑ์ [TK]";
    ViewBag.Descr = "ระบบพัสดุและครุภัณฑ์";
    ViewBag.SubTitle = "ระบบพัสดุและครุภัณฑ์";
}

<div class="block-button-menu-above">
    @if (Model.RecordStatus == KPIS.GERP.Models.SYS.RecordStatus.WaitStatus)
    {
        @Html.ActionLink("  กลับไปหน้าแสดงข้อมูลทั้งหมด", "Index", new { category = Model.StockTakingId }, new { @class = "btn button-standard btn-small icon-reply", role = "button" })
        @Html.ButtonEdit(new { id = Model.StockTakingId })
        @Html.ActionLink("  เพิ่ม", "Create", new { category = Model.StockTakingId }, new { @class = "btn btn-small btn-success button-standard-width icon-plus", role = "button" })
        @Html.ButtonDelete(new { id = Model.StockTakingId })
    }
    else
    {
        @Html.ActionLink("  กลับไปหน้าแสดงข้อมูลทั้งหมด", "Index", new { category = Model.StockTakingId }, new { @class = "btn button-standard btn-small icon-reply", role = "button" })
        @Html.ActionLink("  เพิ่ม", "Create", new { category = Model.StockTakingId }, new { @class = "btn btn-small btn-success button-standard-width icon-plus", role = "button" })
    }
</div>
    
@Html.Partial("_DetailsForm")

<div class="widget-box  collapsed">
	<div class="widget-header header-color-blue2">
        <div class="widget-toolbar">
            <a href="#" data-action="collapse" style="font-size:large;" ><i class="icon-chevron-up"></i>  ข้อมูลพัสดุ</a>
		</div>
    </div>
    <div class="widget-body" style="padding:10px;">
        <div class="widget-main">
            <iframe id="iframeOne" src="@Url.Action("IndexInventoryStockTakingItem", "PurchaseCheckAsset")?StockTakingId=@Model.StockTakingId" frameborder="0" style="width:100%;" ></iframe>
        </div>
    </div>
</div>
<div class="widget-box collapsed">
	<div class="widget-header header-color-blue2">
        <div class="widget-toolbar">
            <a href="#" data-action="collapse" style="font-size:large;" ><i class="icon-chevron-up"></i>  คณะกรรมการ</a>
		</div>
    </div>
    <div class="widget-body" style="padding:10px;">
        <div class="widget-main">
            <iframe id="iframeTwo" src="@Url.Action("IndexInventoryStockTakingCommittee", "PurchaseCheckAsset")?StockTakingId=@Model.StockTakingId" frameborder="0" style="width:100%;" ></iframe>
        </div>
    </div>
</div>


@section scripts
{
    <script>

        var lastHeight1 = 0, curHeight1 = 0, $frame1 = $('#iframeOne');
        setInterval(function () {
            curHeight1 = $frame1.contents().find('body').height() + 40;
            if (curHeight1 != lastHeight1) {
                $frame1.css('height', (lastHeight1 = curHeight1) + 'px');
            }
        }, 500);

        var lastHeight2 = 0, curHeight1 = 0, $frame2 = $('#iframeTwo');
        setInterval(function () {
            curHeight2 = $frame2.contents().find('body').height() + 40;
            if (curHeight2 != lastHeight2) {
                $frame2.css('height', (lastHeight2 = curHeight2) + 'px');
            }
        }, 500);

    </script>
}